package assets
{
	import flash.display.Sprite;
	import flash.display.Stage;
	import flash.filters.BlurFilter;
	
	import gameobjects.Enemy;
	import gameobjects.InvisibleProjectile;
	import gameobjects.Map;
	import gameobjects.Projectile;
	import gameobjects.Tower;
	import gameobjects.TowerProjectile;
	import gameobjects.icons.IconTower;
	
	import managers.TowerDropper;
	
	import states.Game;
	import states.Menu;

	/**
	 * Sadrzi globalne promenljive / konstante
	 */
	public class Globals
	{
		/**
		 * Dimensions
		 */
		public static const SCREEN_WIDTH:int = 800;
		public static const SCREEN_HEIGHT:int = 480;
		public static const FIELD_WIDTH:int = 680;
		public static const FIELD_HEIGHT:int = 408;
		public static const FIELD_OFFSET_X:int = 60;
		public static const FIELD_OFFSET_Y:int = 50;
		public static const TILE_WIDTH:int = 68;
		public static const TILE_HEIGHT:int = 68;
		public static const TILES_X:int = 10;
		public static const TILES_Y:int = 6;
		
		/**
		 * States
		 */
		public static const INTRO_STATE:int = 0;
		public static const MENU_STATE:int = 1;
		public static const GAME_STATE:int = 2;
		public static var state:int = MENU_STATE;
		
		/**
		 * Time
		 */
		public static var currentDate:Date;
		public static var previousDate:Date = new Date();
		public static var dt:Number;
		public static var counter:uint = 0;
		
		/**
		 * Nizovi
		 */
	    public static var enemies:Vector.<Enemy> = new Vector.<Enemy>();
		public static var projectiles:Vector.<TowerProjectile> = new Vector.<TowerProjectile>();
		public static var invisibles:Vector.<InvisibleProjectile> = new Vector.<InvisibleProjectile>();
		public static var towers:Vector.<Tower> = new Vector.<Tower>();
		
		/**
		 * Ikonice
		 */
		
		
		/**
		 * Other
		 */
		public static var stage:Stage;
		public static var game:Game;
		public static var menu:Menu;
		public static var towersMap:Map;
		
		/**
		 * Svasta
		 */
		public static var towerDropper:TowerDropper;
		
		/**
		 * Shadow
		 */
		public static var shadowBlur:BlurFilter = new BlurFilter(8, 8, 20);
		public static function shadow(shiftRight:Number = 0, shiftDown:Number = 0):Sprite
		{
			var s:Sprite = new Sprite();
			s.graphics.beginFill(0x000000);
			s.graphics.drawEllipse(20, 50+shiftDown, 32, 16);
			s.graphics.endFill();
			s.alpha = 0.5;
			s.filters = [Globals.shadowBlur];
			return s;
		}
	}
}